<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>客户详情</title>
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/mui.min.css" />
		<link rel="stylesheet" href="../../../css/iconfont.css" />
		<link rel="stylesheet" href="../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../css/sale/clinci/clinDetail.css" />
		<script src="../../../js/vconsole.min.js"></script>
	</head>

	<body>
		<div class="mui-content" id="clinDetail" v-cloak>
	    	<div class="panel" v-for="roles in infoList.list">
	    		<div class="info">
	    			<li class="mui-table-view-cell">
	    				<span><i class="iconfont icon-icon1 basic-color" ></i></span>
	    				<span>{{roles.name}}</span>
	    				<span class="btn-tag-low" v-for="role in roles.roles">{{role.name}}</span>
	    			</li>
	    			<li class="mui-table-view-cell">
	    				<span><i class="iconfont icon-shouji basic-color"></i>{{roles.phone}}</span>
	    				<!-- <span class="btn-detail right" @tap="toRoamLogin(roles.id)">漫游登录</span> -->
	    			</li>
	    		</div>
	    	</div>
	    	<div class="panel">
	    		<div class="centerCon" >
	    			<ul class="mui-table-view">
					    <li class="mui-table-view-cell"><span>首单日期</span><span>{{infoList.firstOrder|replaceT}}</span></li>
					    <li class="mui-table-view-cell">
					    	<span>连续{{infoList.outOrderDay}}天未出单</span>
	    					<span class="right" @tap="toOrder">累计订单数{{infoList.orderNum}}<i class="iconfont icon-chakangengduo right" ></i></span>
					    </li>
					    <li class="mui-table-view-cell">
					    	<span><i class="iconfont icon-dizhi" ></i></span><span>{{infoList.hospitalName}}</span>
					    </li>
					    <li class="mui-table-view-cell">行政区划:{{infoList.hospitalAddress}}</li>
					    <li class="mui-table-view-cell  saleLists">
					    	<div v-for="sales in infoList.saleVos">
					    		<span>业务员:{{sales.saleName}}</span><span>电话:{{sales.salePhone}}</span><span>编号:{{sales.saleCode}}</span>
						    </div>
					    </li>
					    <li class="mui-table-view-cell"><span>注册时间</span><span>{{infoList.createTime|replaceT}}</span></li> 
					</ul>
	    		</div>
	    	</div>
	    	<div class="panel">
	    		<div class="foot">
	    			<span>客户执业许可证</span><span><i class="iconfont icon-chakangengduo right" ></i></span>
	    		</div>
	    	</div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../../../js/vue.js"></script>
		<script src="../../../js/cmms.js?time=333"></script>
		<script>
			new Vue({
				el:"#clinDetail",
				data:{
					id:'',
					infoList:[],
					roamFlag:true
				},
				mounted(){
//					var vConsole = new VConsole();
					this.loadInfo();
				},
				methods:{
					loadInfo(){
						let _this = this;
						_this.id = location.href.split('=')[1];
//						console.log(_this.id);
						AT.muiAjax('/partner-sale/hosptal/getById','post',
						{
							id:_this.id
						},
						function(res){
//							console.log(res);
							_this.infoList=res;
						});
					},
					toOrder(){
						location.href='../order/order.html?name=clinicOrder&id='+this.id;
					},
					toRoamLogin(userId){
						let _this = this;
						AT.muiAjax('/passport/roamLogin','post',{
							appType: 3,
							userId:userId,
							userType: 3
						},function(realData){
							console.log(realData);
//							_this.token = realData.token;
							localStorage.setItem('state',_this.state);
							localStorage.setItem(_this.state+'_sale_token',realData.token);
							//用于区别漫游登录，true漫游，false不漫游
							localStorage.setItem('roamFlag',_this.roamFlag);
							location.href = '../../doctor/index.html';
						});
					}
				}
			})
		</script>
	</body>
</html>
